home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Abalone 1.4.2 / src / Board.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-21  |  2.3 KB  |  90 lines  |  [TEXT/MPS ]

  1. #ifndef BOARD_H
  2. #define BOARD_H
  3.  
  4. #include "Contest.h"
  5. #include "Rules.h"
  6.  
  7. #include <QuickDraw.h>
  8. #include <String.h>
  9. #include <Types.h>
  10.  
  11.  
  12. #define kBoardSaved    12
  13.  
  14. //    In theory, to be absolutely sure an KO position isn't reached, all boards played
  15. //    would have to be stored, and a possible move would have to be compared against
  16. //    all past boards.
  17. //    This would be a terrible waste of time near the end of a long game,
  18. //    so I cheat a little by only remembering the last few boards,
  19. //    and hope a long gone board position doesn't reappear again.
  20. //    If is does, this program may make an illegal move according to the contest rules,
  21. //    but the probability that this happens is really small.
  22.  
  23. void            InitBoard (void);
  24. void            OpenBoard (void);
  25. unsigned long    CheckSum (BoardPtr);
  26. short            EndOfGame (void);
  27. Boolean            ProcessMove (MovePtr, Boolean animate);
  28. BoardPtr        CurrentBoard (void);
  29. BoardPtr        RecentBoard (void);
  30. void            PushBoard (BoardPtr newBoard);
  31. short            BoardsOnStack (void);
  32. Boolean            PopBoard (void);
  33. Boolean            EqualBoards (BoardPtr, BoardPtr);
  34. unsigned char    Players (void);
  35. void             CopyBoard (BoardPtr from, BoardPtr to);
  36. short            AutoPlay (void);
  37. Point            FieldToLoc (Field f);
  38. Boolean            FieldHasCurrentPlayersBall (Field f);
  39. char            FieldOwner (Field f);
  40. void            InvalItems (WindowPtr window);
  41. void            SizeItems (WindowPtr window);
  42. Boolean            MoveIsKO (MovePtr, short level, short player);
  43. Boolean            BoardIsKO (BoardPtr testBoard);
  44.  
  45. #endif
  46.  
  47. #ifdef BOARD_C
  48.  
  49. #include "Compute.h"
  50. #include "Connection.h"
  51. #include "Error.h"
  52. #include "Game.h"
  53. #include "Global.h"
  54. #include "Interface.h"
  55. #include "Menu.h"
  56. #include "Settings.h"
  57. #include "SoundPlay.h"
  58. #include "Strategies.h"
  59.  
  60. #ifndef THINK_C
  61. #include <Events.h>
  62. #include <Fonts.h>
  63. #include <Memory.h>
  64. #include <OSEvents.h>
  65. #include <OSUtils.h>
  66. #include <Picker.h>
  67. #include <QDOffscreen.h>
  68. #include <QuickDraw.h>
  69. #include <StdIO.h>
  70. #include <StdLib.h>
  71. //#include <SysEqu.h>
  72. #include <TextEdit.h>
  73. #include <Windows.h>
  74. #endif
  75.  
  76.  
  77. void        FrameHexagon (Rect *r);
  78. void        XORBall (Field field);
  79. void        DrawBall (Field field, char color);
  80. void        DrawField (Field field);
  81. void        EraseBall (Field field);
  82. void        InvalBall (Field field);
  83. void        ShowMove (MovePtr move, Boolean animate);
  84. void        ShowPropMove (Field f, short direction, Boolean animate);
  85. void        ShowFlicheMove (MovePtr move, Boolean animate);
  86. void        DrawPoint (Rect *box, short color);
  87.  
  88. #endif
  89.  
  90.